package main

import (
	"PublicChain/Part7-proof-of-work/BLC"
	"fmt"
)

func main() {
	//创建创世区块
	blockchain := BLC.CreateBlockchainWithGenesisBlock()

	//创建新的区块
	blockchain.AddBlockToBlockchain("Send 100RMB To 11111", blockchain.Blocks[len(blockchain.Blocks)-1].Height+1, blockchain.Blocks[len(blockchain.Blocks)-1].Hash)//添加第一个
	blockchain.AddBlockToBlockchain("Send 200RMB To 22222", blockchain.Blocks[len(blockchain.Blocks)-1].Height+1, blockchain.Blocks[len(blockchain.Blocks)-1].Hash)//添加第二个
	blockchain.AddBlockToBlockchain("Send 300RMB To 33333", blockchain.Blocks[len(blockchain.Blocks)-1].Height+1, blockchain.Blocks[len(blockchain.Blocks)-1].Hash)//添加第三个
	blockchain.AddBlockToBlockchain("Send 300RMB To 44444", blockchain.Blocks[len(blockchain.Blocks)-1].Height+1, blockchain.Blocks[len(blockchain.Blocks)-1].Hash)//添加第四个
	fmt.Println("区块链地址：", blockchain)           //创世区块的地址
	fmt.Println("区块地址：", blockchain.Blocks)      //区块链区块位置数组
	fmt.Println("创世区块：", blockchain.Blocks[0])  //第一个区块
	fmt.Println("第二个区块：", blockchain.Blocks[1]) //第二个区块
	fmt.Println("第三个区块：", blockchain.Blocks[2])
	fmt.Println("第四个区块：", blockchain.Blocks[3])
	fmt.Println("第五个区块：", blockchain.Blocks[4])
}
